<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="4.2 简单内存变量的定义&amp;#8195;&amp;#8195;在编程序时，我们往往要根据程序的需要定义一些内存单元。在高级语言程序中，要给存储单元取一个符号名，然后通过引用该符号名来访问其所对应的存储单元，而在汇编语言程序中要灵活一些，它可以给存储单元取符号名，也可以不取符号名。当给存储单元取符号名时，则可通过该符号名来访问其对应的存储单元；当不给存储单元取符号名时，则可通过存储单元的偏移量(有效地址)来">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="4.2 简单内存变量的定义">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2015/04/01/asm14/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="4.2 简单内存变量的定义&amp;#8195;&amp;#8195;在编程序时，我们往往要根据程序的需要定义一些内存单元。在高级语言程序中，要给存储单元取一个符号名，然后通过引用该符号名来访问其所对应的存储单元，而在汇编语言程序中要灵活一些，它可以给存储单元取符号名，也可以不取符号名。当给存储单元取符号名时，则可通过该符号名来访问其对应的存储单元；当不给存储单元取符号名时，则可通过存储单元的偏移量(有效地址)来">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image001_0000.gif">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image001_0000.gif">
<meta property="og:updated_time" content="2019-01-20T14:20:06.842Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="4.2 简单内存变量的定义">
<meta name="twitter:description" content="4.2 简单内存变量的定义&amp;#8195;&amp;#8195;在编程序时，我们往往要根据程序的需要定义一些内存单元。在高级语言程序中，要给存储单元取一个符号名，然后通过引用该符号名来访问其所对应的存储单元，而在汇编语言程序中要灵活一些，它可以给存储单元取符号名，也可以不取符号名。当给存储单元取符号名时，则可通过该符号名来访问其对应的存储单元；当不给存储单元取符号名时，则可通过存储单元的偏移量(有效地址)来">
<meta name="twitter:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image001_0000.gif">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2015/04/01/asm14/">





  <title>4.2 简单内存变量的定义 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2015/04/01/asm14/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">4.2 简单内存变量的定义</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2015-04-01T20:35:39+08:00">
                2015-04-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/汇编教程/" itemprop="url" rel="index">
                    <span itemprop="name">汇编教程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="4-2-简单内存变量的定义"><a href="#4-2-简单内存变量的定义" class="headerlink" title="4.2 简单内存变量的定义"></a>4.2 简单内存变量的定义</h2><p>&#8195;&#8195;在编程序时，我们往往要根据程序的需要定义一些内存单元。在高级语言程序中，要给存储单元取一个符号名，然后通过引用该符号名来访问其所对应的存储单元，而在汇编语言程序中要灵活一些，它可以给存储单元取符号名，也可以不取符号名。当给存储单元取符号名时，则可通过该符号名来访问其对应的存储单元；当不给存储单元取符号名时，则可通过存储单元的偏移量(有效地址)来访问它。</p>
<p>&#8195;&#8195;汇编语言中，常见的数据类型有字节、字和双字等。下面介绍如何定义各种整型类型的内存变量，有关浮点类型变量的定义方式将在第11章中介绍。</p>
<h3 id="4-2-1-内存变量定义的一般形式"><a href="#4-2-1-内存变量定义的一般形式" class="headerlink" title="4.2.1 内存变量定义的一般形式"></a>4.2.1 内存变量定义的一般形式</h3><p>定义数据变量语句是在程序中经常使用的伪指令语句，其一般格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[变量名]　　数据定义符　　表达式1[, 表达式2, …, 表达式n]　　;注释</span><br></pre></td></tr></table></figure>
<p>该定义格式的主要解释如下：</p>
<ol>
<li>变量名必须是一个合法的标识符，它可以写，也可以不写；</li>
<li>数据定义符用于确定内存单元的数据类型，常用的定义符有：DB、DW和DD等；</li>
<li>表达式是定义内存单元时的初值表达式，一个定义语句可以有多个初值表达式，各表达式之间必须用逗号‘，’分开；如果某个存储单元没有初值表达式，则必须用一个问号‘？’来表示；</li>
</ol>
<p>&#8195;&#8195;在定义语句的后面可以书写注释内容，也可以不写。</p>
<p>&#8195;&#8195;在定义变量时，虽然可以不写变量名，但我们建议还是要写，因为不写变量名，就意味着只能用内存单元的偏移量来访问它。这时，一旦内存单元的偏移量发生变化，那么，程序中的所有引用都要修改，这不仅增加了程序维护的工作量，而且也容易因遗漏修改而出错。</p>
<h3 id="4-2-2-字节变量"><a href="#4-2-2-字节变量" class="headerlink" title="4.2.2 字节变量"></a>4.2.2 字节变量</h3><p>&#8195;&#8195;定义字节变量的定义符为DB/BYTE(Define Byte)，每个字节只占一个字节单元。其中：BYTE是MASM 6.0及其以后版本的数据类型说明符，随后的其它类型说明符同此说明。</p>
<p>例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">COUNTER? 　DB　6</span><br><span class="line">DB　&apos;A&apos;, &apos;D&apos;, 0Dh, &apos;$&apos;</span><br><span class="line">TABLE 　DB　1, 3, 5, 7, 9, 11</span><br></pre></td></tr></table></figure>
<p>上面的定义语句经汇编后所产生出的内存单元分配情况如图4.1所示。图中的数据是用十六进制表示的(以后也如此，不再说明)，由引号括起来的字符在内存中是存放其ASCII码值。所以，’D’和0Dh是不同的，前者是字符’D’，后者是数值12的十六进制编码。</p>
<table width="60%"><tr><td>  … </td><td>06</td><td>41</td><td>44</td><td>0D</td><td>24</td><td>01</td><td>03</td><td>05</td><td>07</td><td>09</td><td>0B</td><td>…</td></tr><tr><td>&nbsp;</td><td colspan="5"><img width="11" height="19" src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image001_0000.gif"></td><td><img width="11" height="19" src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image001_0000.gif"></td></tr><tr><td></td><td colspan="5">COUNTER</td><td>TABLE</td></tr></table>

<center><strong>图4.1 内存单元的分配情况示意图</strong></center>

<p>&#8195;&#8195;注意：在上例中，说明语句“DB ‘A’, ‘D’, 0Dh, ‘$’”之前并没有给出变量名，但我们可以从前面的变量名COUNTER一直往后数，或从TABLE往前数，来访问某存储单元，因为它们是一片连续的存储单元，这和高级语言的变量定义有点区别的。在高级语言中，我们一定要用某个标识符来说明变量，也必须用该变量名来访问其所对应的存储单元。</p>
<p>&#8195;&#8195;用定义符DB还可定义一种特殊的数据形式——字符串。在定义字符串时，必须用成对的单引号或双引号把所要的字符括起来，括号内字符的ASCII码将依次存放在相应的字节单元内。例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">MSG1　DB　&apos;I am a student.&apos;</span><br></pre></td></tr></table></figure>
<p>该说明语句所对应的存储单元分布如下所示。为了看起来方便，并没有用字符的ASCII码来存放在相应的存储单元内，而直接用该字符，请不要引起误解。</p>
<table border="1" cellspacing="0" cellpadding="0" width="70%"><tbody><tr><td width="38"><br>… </td><td width="38"><p>‘I’</p></td><td width="38"><p>‘ ‘</p></td><td width="38"><p>‘a’</p></td><td width="38"><p>‘m’</p></td><td width="38"><p>‘ ‘</p></td><td width="38"><p>‘a’</p></td><td width="38"><p>‘ ‘</p></td><td width="38"><p>‘s’</p></td><td width="38"><p>‘t’</p></td><td width="38"><p>‘u’</p></td><td width="38"><p>‘d’</p></td><td width="39"><p>‘e’</p></td><td width="39"><p>‘n’</p></td><td width="39"><p>‘t’</p></td><td width="39"><p>…</p></td></tr></tbody></table>

<p>上面的例子也可改写为另一种等价的语句：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">MSG1　DB　&apos;I&apos;, &apos; &apos;, &apos;a&apos;, &apos;m&apos;,  &apos; &apos;, &apos;a&apos;, &apos; &apos;, &apos;s&apos;, &apos;t&apos;, &apos;u&apos;, &apos;d&apos;, &apos;e&apos;, &apos;n&apos;, &apos;t&apos;, &apos;.&apos;</span><br></pre></td></tr></table></figure>
<p>显然，前者的说明要比后者方便得多，所以，在程序中都采用前者的书写方式。</p>
<h3 id="4-2-3-字变量"><a href="#4-2-3-字变量" class="headerlink" title="4.2.3 字变量"></a>4.2.3 字变量</h3><p>定义字变量的定义符为DW/WORD(Define Word)，每个字占用两个连续的字节单元。</p>
<p>例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Word1　DW　89H, 1909H, -1</span><br><span class="line"> DW　0abcdH,  , 0</span><br></pre></td></tr></table></figure>
<p>上述定义的内存分配如下所示。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">…   89   00    09   19   FF    FF    CD    AB     --  --  00    00</span><br></pre></td></tr></table></figure>
<p>由于字变量的数据是按照“高高低低”的原则存于存储单元之中的，而字节数据是按照排列顺序存于存储单元中的，所以，它们的存储方式有所不同。<br>试比较下面两个定义的存储顺序，其中：41H和42H分别是’A’和’B’的ASCII码。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">B1　DB　&apos;AB&apos;</span><br><span class="line">  W1　DW　&apos;AB&apos;</span><br><span class="line">  … 41h 42h 42h 41h …</span><br></pre></td></tr></table></figure>
<h3 id="4-2-4-双字变量"><a href="#4-2-4-双字变量" class="headerlink" title="4.2.4 双字变量"></a>4.2.4 双字变量</h3><p>定义双字变量的定义符为DD/DWORD(Define Doubleword)，每个双字变量占用二个连续的字单元(四个字节)。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">DW1　DD　12345678H, </span><br><span class="line">DW2　DD　0abcd1243H</span><br></pre></td></tr></table></figure>
<p>上述定义的内存分配如下所示。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">…    78    56    34    12    --   --   --   --   43    12    CD     AB     …</span><br></pre></td></tr></table></figure>
<h3 id="4-2-5-六字节变量"><a href="#4-2-5-六字节变量" class="headerlink" title="4.2.5 六字节变量"></a>4.2.5 六字节变量</h3><p>定义六字节变量的定义符为DF/FWORD(Define Farword)。顾名思义，每个六字节变量占用六个连续的字节。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">DF1　DF　1234567890abH, -1</span><br><span class="line"> DF　1abcd23H</span><br></pre></td></tr></table></figure>
<p>上述定义的内存分配如下所示。</p>
<table border="1" width="100%"><tr><td width="5%"><br>… </td><td width="5%"><p>abH</p></td><td width="5%"><p>90H</p></td><td width="5%"><p>78H</p></td><td width="5%"><p>56H</p></td><td width="5%"><p>34H</p></td><td width="5%"><p>12H</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>0FFH</p></td><td width="5%"><p>23hH</p></td><td width="5%"><p>0cdH</p></td><td width="5%"><p>0abH</p></td><td width="5%"><p>01H</p></td><td width="5%"><p>00H</p></td><td width="5%"><p>00H</p></td><td width="5%"><p>…</p></td></tr></table>

<h3 id="4-2-6-八字节变量"><a href="#4-2-6-八字节变量" class="headerlink" title="4.2.6 八字节变量"></a>4.2.6 八字节变量</h3><p>定义八字节变量的定义符为DQ/QWORD(Define Quadword)。同理，每个八字节变量占用八个连续的字节。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">DQ1　DQ　12345678H, 0H,  -1234H</span><br><span class="line"> DQ　 , 1238H,</span><br></pre></td></tr></table></figure>
<p>第一个八字节常量12345678H在内存中的分配方式如下所示，其存储原则与前面相同。其它八字节常量的存储方式与此一致。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">…    78    56     34    12    00    00     00    00    …</span><br></pre></td></tr></table></figure>
<h3 id="4-2-7-十字节变量"><a href="#4-2-7-十字节变量" class="headerlink" title="4.2.7 十字节变量"></a>4.2.7 十字节变量</h3><p>定义十字节变量的定义符为DT/TBYTE(Define Tenbytes)。同理，每个十字节变量占用十个连续的字节。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">DT1　DT　12345678H, 0H,  -1234H</span><br><span class="line"> DT2　DT　 , -1H</span><br></pre></td></tr></table></figure>
<p>第一个十字节常量12345678H在内存中的分配方式如下所示，它同样按“高高低低”的原则来存储。其它十字节常量的存储方式与此一致。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">…   78   56   34   12   00   00    00    00    00    00    …</span><br></pre></td></tr></table></figure>
<p>以上六个数据类型是汇编语言中最基本的数据类型，其中，前三个是在程序中经常使用的，后三个的使用频率不太高。</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2015/04/01/asm13/" rel="next" title="4.1 标识符">
                <i class="fa fa-chevron-left"></i> 4.1 标识符
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2015/04/01/asm15/" rel="prev" title="4.3 调整偏移量伪指令">
                4.3 调整偏移量伪指令 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#4-2-简单内存变量的定义"><span class="nav-number">1.</span> <span class="nav-text">4.2 简单内存变量的定义</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-1-内存变量定义的一般形式"><span class="nav-number">1.1.</span> <span class="nav-text">4.2.1 内存变量定义的一般形式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-2-字节变量"><span class="nav-number">1.2.</span> <span class="nav-text">4.2.2 字节变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-3-字变量"><span class="nav-number">1.3.</span> <span class="nav-text">4.2.3 字变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-4-双字变量"><span class="nav-number">1.4.</span> <span class="nav-text">4.2.4 双字变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-5-六字节变量"><span class="nav-number">1.5.</span> <span class="nav-text">4.2.5 六字节变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-6-八字节变量"><span class="nav-number">1.6.</span> <span class="nav-text">4.2.6 八字节变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-7-十字节变量"><span class="nav-number">1.7.</span> <span class="nav-text">4.2.7 十字节变量</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
